local zhoupo = fk.CreateSkill{
  name = "lingling__zhoupo",
}

Fk:loadTranslationTable{
  ["lingling__zhoupo"] = "骤破",
  [":lingling__zhoupo"] = "准备阶段，你可以摸一张牌并视为对一名其他角色使用【杀】或【水淹七军】，若未造成伤害则你弃置两张牌。",

  ["#lingling__zhoupo-invoke"] = "骤破：你可以摸一张牌并视为使用一张【杀】或【水淹七军】",
}

zhoupo:addEffect(fk.EventPhaseStart, {
  anim_type = "offensive",
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(zhoupo.name) and player.phase == Player.Start and
      table.find({"slash", "ling__drowning"}, function (name)
        return player:canUse(Fk:cloneCard(name), { bypass_distances = true, bypass_times = true })
      end)
  end,
  on_cost = function(self, event, target, player, data)
    local room = player.room
    local use = room:askToUseVirtualCard(player, {
      name = { "slash", "ling__drowning" },
      skill_name = zhoupo.name,
      prompt = "#lingling__zhoupo-invoke",
      cancelable = true,
      extra_data = {
        bypass_distances = true,
        bypass_times = true,
        extraUse = true,
      },
      skip = true,
    })
    if use then
      event:setCostData(self, {extra_data = use})
      return true
    end
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    local use = event:getCostData(self).extra_data
    player:drawCards(1, zhoupo.name)
    room:useCard(use)
    if not (use and use.damageDealt) and not player.dead then
      room:askToDiscard(player, {
        min_num = 2,
        max_num = 2,
        include_equip = true,
        skill_name = zhoupo.name,
        cancelable = false,
      })
    end
  end,
})

return zhoupo
